<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>GroovySci</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0  (Solaris x86)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20090409;14120800">
	<META NAME="Info 1" CONTENT="">
	<META NAME="Info 2" CONTENT="">
	<META NAME="Info 3" CONTENT="">
	<META NAME="Info 4" CONTENT="">
	<META NAME="CHANGEDBY" CONTENT="Stergios Papadimitriou">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1>Optimization Examples</H1>
<TABLE WIDTH=676 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 STYLE="page-break-before: always">
	<COL WIDTH=407>
	<COL WIDTH=251>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P STYLE="font-style: normal"><B>jacobnnf:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">Compute
			approximations to the partial derivatives </SPAN>
			<IMG SRC="Optimization_htm_484bee13.gif" NAME="Object1" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=131 HEIGHT=20 BORDER=0>
			<SPAN STYLE="font-weight: normal">of the components of the
			function </SPAN><I><SPAN STYLE="font-weight: normal">f(x) </SPAN></I><SPAN STYLE="font-weight: normal">given
			by </SPAN>
			</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_htm_58e40258.gif" NAME="Object2" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=74 HEIGHT=22 BORDER=0>
						<IMG SRC="Optimization_htm_m4ae5fbec.gif" NAME="Object3" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=69 HEIGHT=20 BORDER=0></P>
			<P ALIGN=LEFT STYLE="font-style: normal; font-weight: normal">at
			the point x =(2,1)</P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="jacobnnf.ssci">jacobnnf.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>jacobnmf:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">Compute
			approximations to the partial derivatives </SPAN>
			<IMG SRC="Optimization_htm_m517588e6.gif" NAME="Object4" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=178 HEIGHT=20 BORDER=0>
			<SPAN STYLE="font-weight: normal">of the components of the
			function </SPAN><I><SPAN STYLE="font-weight: normal">f(x) </SPAN></I><SPAN STYLE="font-weight: normal">given
			by </SPAN>
			</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_htm_58e40258.gif" NAME="Object5" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=74 HEIGHT=22 BORDER=0>
						<IMG SRC="Optimization_htm_m5ff7817f.gif" NAME="Object6" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=114 HEIGHT=20 BORDER=0><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">,
			</SPAN></SPAN>
			<IMG SRC="Optimization_htm_m72606d9c.gif" NAME="Object7" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=66 HEIGHT=20 BORDER=0>
						</P>
			<P ALIGN=LEFT STYLE="font-style: normal; font-weight: normal"><A NAME="DDE_LINK"></A>
			at the point x =(2,1)</P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="jacobnmf.ssci">jacobnmf.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>jacobnbndf:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">Compute
			approximations to the partial derivatives </SPAN>
			<IMG SRC="Optimization_htm_4e0425b4.gif" NAME="Object8" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=328 HEIGHT=20 BORDER=0>
			<SPAN STYLE="font-weight: normal">of the components of the
			function </SPAN><I><SPAN STYLE="font-weight: normal">f(x) </SPAN></I><SPAN STYLE="font-weight: normal">given
			by </SPAN>
			</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_htm_m46799968.gif" NAME="Object9" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=173 HEIGHT=20 BORDER=0>
						<IMG SRC="Optimization_htm_m41227389.gif" NAME="Object10" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=301 HEIGHT=20 BORDER=0>
						<IMG SRC="Optimization_htm_m7efab57c.gif" NAME="Object11" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=110 HEIGHT=20 BORDER=0>
						</P>
			<P ALIGN=LEFT STYLE="font-style: normal; font-weight: normal">at
			the point x = (-1, -1, -1, -1, -1)</P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="jacobnbndf.ssci">jacobnbndf.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>zeroin:</B></P>
			<P STYLE="font-weight: normal">Determine a zero of 
			<IMG SRC="Optimization_htm_7749d133.gif" NAME="Object12" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=109 HEIGHT=21 BORDER=0>
			in the interval [0, 1].</P>
			<P ALIGN=JUSTIFY><I><B>zeroin</B></I> <I><SPAN STYLE="font-weight: normal">is
			preferable for simple (i.e. cheaply to calculate) functions and/or
			when no high precision is required</SPAN></I></P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="zeroin.ssci">zeroin.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>zeroinrat:</B></P>
			<P STYLE="font-weight: normal">Determine a zero of 
			<IMG SRC="Optimization_htm_7749d133.gif" NAME="Object13" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=109 HEIGHT=21 BORDER=0>
			in the interval [0, 1].</P>
			<P ALIGN=JUSTIFY><I><B>zeroinrat</B> <SPAN STYLE="font-weight: normal">is
			preferable for complicated (i.e. expensive) functions when a zero
			is required in rather high precision and also for functions having
			a pole near the zero</SPAN></I></P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="zeroinrat.ssci">zeroinrat.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>zeroinder:</B></P>
			<P STYLE="font-weight: normal">Determine a zero of 
			<IMG SRC="Optimization_htm_7749d133.gif" NAME="Object14" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=109 HEIGHT=21 BORDER=0>
			in the interval [0, 1].</P>
			<P ALIGN=JUSTIFY><I><B>zeroinder</B> <SPAN STYLE="font-weight: normal">is
			to prefer to zeroin or zeroinrat if the derivative is (much)
			cheaper to evaluate than the function</SPAN></I></P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="zeroinder.ssci">zeroinder.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>quanewbnd1: </B>
			</P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">Solves systems of
			nonlinear equations of which the Jacobian is known to be band
			matrix and an approximation of the Jacobian is assumed to be
			available at the initial guess. 
			</P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">Solve the system of
			equations 
			<IMG SRC="Optimization_html_14d5696d.gif" NAME="Object15" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=124 HEIGHT=21 BORDER=0>
			where 
			</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_html_m421183c4.gif" NAME="Object16" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=327 HEIGHT=64 BORDER=0></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">with initial
			approximation 
			<IMG SRC="Optimization_html_m75e4b50d.gif" NAME="Object17" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=139 HEIGHT=22 BORDER=0>,
			for 
			<IMG SRC="Optimization_html_738f0d3d.gif" NAME="Object18" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=53 HEIGHT=18 BORDER=0>.</P>
			<P ALIGN=JUSTIFY><BR>
			</P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="quanewbnd1.ssci">quanewbnd1.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>minin:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">determines a point 
			<IMG SRC="Optimization_htm_618bf4a8.gif" NAME="Object19" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=64 HEIGHT=18>
			at which the real valued function assumes a minimum value</P>
			<P>     <B>double</B>  <B>minin( x, a, b, method)</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal"><I>minin: </I><SPAN STYLE="font-style: normal">delivers
			the calculated minimum value of the function, defined by </SPAN><I>fx,
			</I><SPAN STYLE="font-style: normal">on the interval with
			endpoints </SPAN><I>a </I><SPAN STYLE="font-style: normal">and </SPAN><I>b;</I></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal; font-weight: normal"><I>x:
			</I>  double <I>x[0:0];</I></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal; font-weight: normal"> 
			     entry:  the actual parameter for <I>fx</I> and <I>tolx
			</I>depends on <I>x;</I></P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal; font-weight: normal"> 
			     exit:   the calculated approximation of the position of the
			minimum;</P>
			<P ALIGN=JUSTIFY STYLE="font-style: normal; font-weight: normal"> 
			</P>
			<P><BR>
			</P>
		</TD>
		<TD WIDTH=251>
			<P><A HREF="minin.ssci">minin.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>mininder:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">determines a point 
			<IMG SRC="Optimization_htm_618bf4a8.gif" NAME="Object20" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=64 HEIGHT=18>
			at which the real valued function assumes a minimum value, when
			the analytical derivative <I>Df(x) </I><SPAN STYLE="font-style: normal">of
			the function is available</SPAN></P>
			<P>     <B>double</B>  <B>mininder( x, y, method)</B></P>
			<P><BR><BR>
			</P>
			<P> 
			</P>
		</TD>
		<TD WIDTH=251>
			<P><B>Example:</B></P>
			<P STYLE="font-weight: normal">Determine an approximation to the
			point in the interval [1.01, 3.99] at which the function</P>
			<P STYLE="font-weight: normal"><IMG SRC="Optimization_htm_60110d2d.gif" NAME="Object21" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=204 HEIGHT=44></P>
			<P><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-weight: normal">assumes
			a minimum value</SPAN></SPAN></P>
			<P><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-weight: normal">The
			derivative of this function is:</SPAN></SPAN></P>
			<P><SPAN STYLE="text-decoration: none"><IMG SRC="Optimization_htm_2c464367.gif" NAME="Object22" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=193 HEIGHT=44></SPAN></P>
			<P><A HREF="mininder.ssci">mininder.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>praxis:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">determines a point <I>x
			</I><SPAN STYLE="font-style: normal">at which the function </SPAN><I>f(x)
			</I><SPAN STYLE="font-style: normal">is a minimum, an initial
			approximation to </SPAN><I>x</I><SPAN STYLE="font-style: normal">
			is to be provided </SPAN>
			</P>
		</TD>
		<TD WIDTH=251>
			<P ALIGN=JUSTIFY>Calculate the minimum of the function</P>
			<P><IMG SRC="Optimization_htm_6249adff.gif" NAME="Object23" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=200 HEIGHT=22></P>
			<P>using (-1.2, 1) as an initial estimate</P>
			<P><A HREF="praxis.ssci">praxis.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>More variables – Gradient available</B></P>
			<P><B>rnk1min, flemin:</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">rnk1min:  is suitable
			for use in connection  with problems for which the <I>nXn</I><SPAN STYLE="font-style: normal">
			Hessian matrix </SPAN><I>G(x), </I><SPAN STYLE="font-style: normal">is
			almost singular at the minimum</SPAN></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal"><SPAN STYLE="font-style: normal">flemin:
			 is suitable, in particular, for use in connection with problems
			for which </SPAN><I>n </I><SPAN STYLE="font-style: normal">is
			relatively large and the computation of </SPAN><I>F(x)</I><SPAN STYLE="font-style: normal">
			and </SPAN><I>g(x)</I><SPAN STYLE="font-style: normal"> is
			relatively cheap</SPAN></P>
		</TD>
		<TD WIDTH=251>
			<P>Determine the value of<IMG SRC="Optimization_htm_m2797c7fb.gif" NAME="Object24" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=72 HEIGHT=20></P>
			<P>yielding a minimum  of the function 
			</P>
			<P><IMG SRC="Optimization_htm_6249adff.gif" NAME="Object25" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=200 HEIGHT=22></P>
			<P>twice: firstly by use of <I>rnk1min, </I><SPAN STYLE="font-style: normal">
			and secondly by </SPAN><I>flemin. </I><SPAN STYLE="font-style: normal">In
			both cases the initial approximation is taken to be (-1.2, 1)</SPAN></P>
			<P><A HREF="rnk1min.ssci"><SPAN STYLE="font-style: normal">rnk1min.ssci</SPAN></A></P>
			<P><BR>
			</P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><B>Overdetermined nonlinear systems</B></P>
			<P><B>Least squares – With Jacobian matrix</B></P>
			<P ALIGN=JUSTIFY STYLE="font-weight: normal">marquardt: calculates
			the least squares solution of an overdetermined system of
			nonlinear equations with Marquardt's method</P>
		</TD>
		<TD WIDTH=251>
			<P>Determine the parameters 
			<IMG SRC="Optimization_htm_m17617888.gif" NAME="Object26" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=60 HEIGHT=20>
			of best fit of the function:</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_htm_531f450.gif" NAME="Object27" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=183 HEIGHT=20></P>
			<P ALIGN=JUSTIFY>when 
			<IMG SRC="Optimization_htm_b4e8b96.gif" NAME="Object28" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=41 HEIGHT=20>,
			to data readings 
			<IMG SRC="Optimization_htm_m2b14c491.gif" NAME="Object29" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=95 HEIGHT=20>,
			where 
			<IMG SRC="Optimization_htm_65350d95.gif" NAME="Object30" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=60 HEIGHT=20>are
			-5,-3,-1,1,3,5, and  
			<IMG SRC="Optimization_htm_m6575c7d3.gif" NAME="Object31" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=63 HEIGHT=20>
			are 127.0, 151.0, 379.0, 421.0, 460.0, 426.0</P>
			<P ALIGN=JUSTIFY><A HREF="marquardt.ssci">marquardt.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P ALIGN=JUSTIFY><B>gssnewton:</B><SPAN STYLE="font-weight: normal">
			 calculates the least squares solution of an overdetermined system
			of nonlinear equations with the Gauss-Newton method</SPAN></P>
		</TD>
		<TD WIDTH=251>
			<P>Determine the parameters 
			<IMG SRC="Optimization_htm_m17617888.gif" NAME="Object36" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=60 HEIGHT=20>
			of best fit of the function:</P>
			<P ALIGN=CENTER><IMG SRC="Optimization_htm_531f450.gif" NAME="Object37" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=183 HEIGHT=20></P>
			<P ALIGN=JUSTIFY>when 
			<IMG SRC="Optimization_htm_b4e8b96.gif" NAME="Object32" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=41 HEIGHT=20>,
			to data readings 
			<IMG SRC="Optimization_htm_m2b14c491.gif" NAME="Object33" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=95 HEIGHT=20>,
			where 
			<IMG SRC="Optimization_htm_65350d95.gif" NAME="Object34" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=60 HEIGHT=20>are
			-5,-3,-1,1,3,5, and  
			<IMG SRC="Optimization_htm_m6575c7d3.gif" NAME="Object35" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=63 HEIGHT=20>
			are 127.0, 151.0, 379.0, 421.0, 460.0, 426.0.</P>
			<P ALIGN=JUSTIFY><A HREF="gssnewton.ssci">gssnewton.ssci</A></P>
		</TD>
	</TR>
	<TR VALIGN=TOP>
		<TD WIDTH=407>
			<P><BR>
			</P>
		</TD>
		<TD WIDTH=251>
			<P><BR>
			</P>
		</TD>
	</TR>
</TABLE>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
</BODY>
</HTML>